﻿@{
    ViewBag.Title = Local("ForumsView.PageTitle");
}

@model IEnumerable<Forum>
           
@if (Model != null)
{ 
<div class="box">
    <div class="tright">
        <button onclick="go('@CUrls.NewForumView');">@GLocal("Forum.New")</button>
    </div>
    <table cellpadding="0" cellspacing="0">
        <thead class="ui-widget-header">
            <tr>
                <td>@GLocal("Forum.ForumName")</td>
                <td>@GLocal("Forum.Key")</td>
                <td>@GLocal("Forum.CreateDate")</td>
                <td>@GLocal("Forum.IsVisiable")</td>
                <td>@GLocal("Forum.Action")</td>
            </tr>
        </thead>
        <tbody>
            @foreach (var forum in Model)
            { 
            <tr>
                <td>├─@forum.ForumName</td>
                <td>@forum.Key</td>
                <td>@forum.CreateDate.ToLocalDateTimeString()</td>
                <td>@CPHelper.ShowBoolean(forum.IsVisiable)</td>
                <td>
                    <a href="javascript:void(0);" onclick="return openModal('@CUrls.DialogCategoryView?id=@forum.ForumID', 500);">@GLocal("Category.Edit")</a>
                    @Html.AjaxLink(HttpAction.Delete, "Category.Delete", new { did = forum.ForumID })
                </td>
            </tr>  
                if (forum.Children != null)
                {
                    @CPHelper.ShowForums(forum, 1)
                }
            }
        </tbody>
    </table>
</div>
}